#ifndef GHOST_H_
#define GHOST_H_

#include "SimulatorRegister.h"
#include "Direction.h"
#include "Position.h"
#include "Shell.h"

class ShellProxy;

// Ghost controlls the object
// but can only make request
// the base object is a Proxy to Shell that contains the data

class Ghost
{
public:
    Ghost(SimulatorRegister * registration);
    virtual ~Ghost();
    
    void bind(SimulatorRegister * registration);
    bool isBound();
        
    // give info to others
//    const Flags & getFlags() const;
    const Position & getPosition() const;
    bool isActive() const;


    //what to do...
    virtual void onNewUniverse(SimulatorRegister * registration) = 0;
    virtual void onCollide(const Ghost * ghost) = 0;
    virtual void onContact(const Ghost * ghost) = 0;    
    virtual void spawn() = 0;
    virtual void die() = 0;

protected:
    // what we can do (it's a bureaucracy)
    bool requestMove(Direction & dir);
    bool requestPosition(Position & pos);
//  bool requestFlag( vb hiddenFlag);

    // request information about others
//    void getInfoAbout(Ghost * other);
//    const Ghost * getGhostAt(Position & position);
    
private:
    bool valid;
    ShellProxy * shellProxy;
    SimulatorRegister * registration;
};

#endif /*GHOST_H_*/

